fix: small nil-check for schedules during migration#10725
Draft
davidporter-id-au wants to merge 2 commits into
Draft
fix: small nil-check for schedules during migration#10725davidporter-id-au wants to merge 2 commits into
davidporter-id-au wants to merge 2 commits into
Conversation
CreateSchedulerFromMigration stored whatever LastCompletionResult the migrated
V1 state carried, which is nil when the schedule had no prior completion (e.g.
migrated before its first action) — convertLastCompletionLegacyToCHASM returns
nil in that case. InvokerExecuteTaskHandler.startWorkflow then dereferences
lastCompletionState.Success/.Failure unconditionally, panicking on the first
workflow start after migration.
The normal CreateScheduler/NewScheduler path defaults to a non-nil empty
&schedulerpb.LastCompletionResult{}, so it never hit this. Default to the same
non-nil empty value in CreateSchedulerFromMigration.
Found by the V2->V1->V2 migration round-trip test.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
(cherry picked from commit 23ad378b19a638df2603c47c0e3a806e9877bf2e)
This was referenced Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CreateSchedulerFromMigrationstored whateverLastCompletionResultthe migrated V1 state carried, which isnilwhen the schedule had no prior completion (e.g. migrated before its first action) —convertLastCompletionLegacyToCHASMreturns nil in that case.InvokerExecuteTaskHandler.startWorkflowthen dereferenceslastCompletionState.Success/.Failureunconditionally, panicking on the first workflow start after migration.The normal
CreateScheduler/NewSchedulerpath defaults to a non-nil empty&schedulerpb.LastCompletionResult{}, so it never hit this. This change defaults to the same non-nil empty value inCreateSchedulerFromMigration.How found
Surfaced by the V2→V1→V2 migration round-trip test (top of the stack below).
Stack
This is the base of a stack of scheduler test-coverage PRs (review in order):
Test plan
go build ./chasm/lib/scheduler/...